﻿<html xmlns:wb="http://open.weibo.com/wb">
<head>
    <title></title>
    <script src="http://tjs.sjs.sinajs.cn/open/api/js/wb.js?appkey=3640942651" type="text/javascript"
        charset="utf-8"></script>
</head>
<body>
<wb:login-button type="3,2" onlogin="login" onlogout="logout" id="wb_connect_btn">登录按钮</wb:login-button><br />
<a target="_blank" href="http://1diantao.sinaapp.com">访问一点淘网站看你淘的货儿</a>
<script>
    var backgroundPage = chrome.extension.getBackgroundPage;
    WB2.anyWhere(function (W) {
        W.widget.connectButton({
            id: "wb_connect_btn",
            type: "3,2",
            callback: {
                login: function (o) {
                    alert(JSON.stringify(o.id));
                    backgroundPage.saveUserId(o.id);
                },
                logout: function () {
                    backgroundPage.saveUserId(null);
                }
            }
        });
    });

    function login() {
        alert(1);
    }

    function logout() {
        alert(2);
    }
</script>
</body>
</html>
